import com.sun.org.apache.xpath.internal.objects.XString;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 9,57,5, 6, 7};
        //transform(array);
       // func(array);
       //int[] arr1 = func1(array,11);
        //System.out.println(Arrays.toString(arr1));
        //boolean flg = func2(array);
        //System.out.println(flg);

    }
    public static boolean func2(int[] arr) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % 2 != 0) {
                count++;
                if (count == 3) {
                    return true;
                }
            } else {
                count = 0;
            }
        }   return false;
    }
    public static int[] func1(int[] arr, int k) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = i+1; j < arr.length; j++) {
                if (arr[i] + arr[j] == k) {
                    int[] arr1 = {i,j};
                    return arr1;
                }

            }
        }
        return null;
    }

    public static void func(int[] array1) {
        int i = 0;
        int j = array1.length - 1;
        while (i < j) {
            while (i < j && array1[i] % 2 != 0) {
                i++;
            }
            while (i < j && array1[j] % 2 == 0) {
                j--;
            }
            int tmp = array1[i];
            array1[i] = array1[j];
            array1[j] = tmp;
        }
    }

    public static void transform(int[] array) {
        for (int i = 0; i < array.length; i++) {
            array[i] *= 2;
        }

    }


}
